package com.wipz.eoa.iphone.seal;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.wipz.eoa.iphone.BaseAction;
import com.wipz.eoa.iphone.IBaseService;

public class SealManagementAction extends BaseAction{
	private static final long serialVersionUID = 1L;
	private IBaseService baseService;
	private ISealManagementService sealManagementService;
	@SuppressWarnings("unchecked")
	private List list;//用印管理列表
	private Object detail;// 用印管理详情
	public void setBaseService(IBaseService baseService) {
		this.baseService = baseService;
	}
	public IBaseService getBaseService() {
		return baseService;
	}

	public void setDetail(Object detail) {
		this.detail = detail;
	}
	public Object getDetail() {
		return detail;
	}
	/**
	 * 用印管理列表
	 *  @return
	 * @throws UnsupportedEncodingException
	 */
	public String list() {
		String sealname=this.getRequest().getParameter("sealname");
		try {
			String s = new String(sealname.getBytes("iso-8859-1"),"utf-8");
			sealname= java.net.URLDecoder.decode(s, "utf-8");
		} catch (UnsupportedEncodingException e) {
			return SUCCESS;
		}
		//String COMMITERCODE = this.getRequest().getParameter("COMMITERCODE");
	//	if(COMMITERCODE.isEmpty()) {
		//	return SUCCESS;
		//}
		Map<String,String>	parms = new HashMap<String,String>();
		parms.put("sealname", sealname);
		//params.put("COMMITERCODE", COMMITERCODE);
		list=sealManagementService.queryList("seal.querymanagement", parms);
		System.out.println(list.size());
		return SUCCESS;
		
	}
	
	/**
	 * 查询用印管理详情信息
	 * @return
	 * 2012-1-13 05:10:18
	 */
	public String detail() {
		String id = this.getRequest().getParameter("id");
		if(id.isEmpty()) {
			return SUCCESS;
		}
		if(StringUtils.isNotEmpty(id)){
			Map<String, String> params = new HashMap();
			params.put("id", id);
			detail=baseService.queryOne("seal.queryManagementById", params);
			//System.out.println(detail);
		}
		return SUCCESS;
	}

	public void setList(List list) {
		this.list = list;
	}
	public List getList() {
		return list;
	}
	public void setSealManagementService(ISealManagementService sealManagementService) {
		this.sealManagementService = sealManagementService;
	}
	public ISealManagementService getSealManagementService() {
		return sealManagementService;
	}
}
